// 职位名搜索
const jobInp=$('#search>div:nth-child(2) input');
let job='';
// 行业搜索
const indSeltop=$('#search>div:nth-child(3) select');
let industrytop='';
// 工作经验搜索
const jobyearSel=$('#shaixuan>div:first-child select');
let jobyear='';
// 行业搜索
const indSelsmall=$('#shaixuan>div:nth-child(2) select');
let industrysmall='';
// 薪资范围
let money=0;
// 最低薪资
const minmoneyInp=$('#shaixuan>div:nth-child(3)>div:first-child input');
let minmoney=0;
// 最高薪资
const maxmoneyInp=$('#shaixuan>div:nth-child(3)>div:last-child input');
let maxmoney=0;
// 学历要求
const edurequireSel=$('#shaixuan>div:nth-child(4) select');
let edurequire='';
// 公司规模
const sizeSel=$('#shaixuan>div:nth-child(5) select');
let size='';
// 个人账号id
let id=localStorage.getItem('id');

// 渲染行业下拉列表
// 从后台获取行业表的数据
$.ajax({
    url:'/selectInd',
    method:'post',
    success:(res)=>{
        res.industry.forEach(item=>{
            indSeltop.append(`<option>${item.ind_name}</option>`);
            indSeltop.children().eq(2).css({
                display:'none'
            });
            indSelsmall.append(`<option>${item.ind_name}</option>`);
            indSelsmall.children().eq(2).css({
                display:'none'
            });
        });
    }
});

// 渲染职位列表
// 从后台获取招聘信息表的数据
$.ajax({
    url:'/selectjob',
    method:'post',
    success:(res)=>{
        res.job.data[0].forEach(item=>{
            $('#zhiweiliebiao>div').append(`
            <div class="row zhiwei">
                <div class="col-md-10">
                    <div class="row">
                        <div class="col-md-3">
                            <span>货运搬运工</span>
                            <span>3K-6K</span>
                        </div>
                        <div class="col-md-3 col-md-offset-1">
                            <img src="../images/morentouxiang.png" alt="#">
                            <span>杨丽</span>
                            <span>|</span>
                            <span>招聘HR</span>
                        </div>
                        <div class="col-md-3 col-md-offset-1">
                            <span>广州新邦物流</span>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-3">
                            <span>广州</span>
                            <span>3-5年</span>
                            <span>大专</span>
                        </div>
                        <div class="col-md-3 col-md-offset-1">
                            <span>发布于</span>
                            <span>2018-07-03</span>
                        </div>
                        <div class="col-md-3 col-md-offset-1">
                            <span>物流行业</span>
                            <span>|</span>
                            <span>2000人以上</span>
                        </div>
                    </div>
                </div>
                <div class="col-md-2">
                    <img src="../images/morenlogo.jpg" alt="#">
                </div>
            </div>
        `)
        })
    }
});




























// 点击职位跳转到公司简介
$('.zhiwei').on('click',function(){
    location.href='../html/gongsijianjie.html';
})